Anton Lydike — Blog
Website GitHub

Removing null-entries in GPX tracks

Written: 2025-06-24
Tags: #how-to #snippet

A friend of mine and me recently needed to remove a bunch of null/null coordinates from a GPX track, after a while, this is what we came up with (uses xmlstarlet and is prefixed with the shiny new nix run stuff!):

nix run "nixpkgs#xmlstarlet" -- ed -N gpx="http://www.topografix.com/GPX/1/1" -d '//gpx:trkpt[@lat="0" and @lon="0"]' infile.gpx > infile_clean.gpx